def dfs(s, k, up, _i, p):
    global ans
    if k == 1 and s < ans:
        ans = s
    for i in range(2, min(k, up)+1):
        if k%i == 0 :
            ss = s
            for j in range(1, i):
                ss *= p[_i];   # ss *= p[_i]**(i-1)
                if ans < ss :
                    return
            dfs(ss, k//i, i, _i+1, p)
 
while True:
    try:
        global ans
        #  ans = float('inf')
        #  ans = 1<<2048
        ans = '1'
        for _ in range(450):
            ans += '0'
        ans = int(ans)
        n = int(input())
        p = (2,3,5,7,11,13,17,19,23,29)
        dfs(1, n, n, 0, p)
        print(ans)
    except:
        break